<template>
  <common-view class="compose-page">
    <design-view>
      <div class="compose-area">
        <div class="compose-content">
          <img v-if="poster" :src="poster" alt=""/>
        </div>
      </div>
      <div class="text-tip animate__animated animate__flash animate__infinite animate__slower">
        <span>长按保存海报至相册</span>
      </div>
      <div class="btn btn-lottery animate__animated animate__headShake animate__infinite" @click="onClick">{{ btnText }}</div>
    </design-view>
  </common-view>
</template>
<script>
import { mapState } from 'vuex'
export default {
  name: 'ComposePictureView',
  computed: {
    ...mapState(['poster'])
  },
  props: {
    btnText: {
      type: String,
      default: '立即抽奖'
    }
  },
  methods: {
    onClick () {
      this.$emit('next-page')
      this.$emit('click')
      this.$sound && this.$sound.play()
    }
  }
}
</script>
<style lang="scss" scoped>
@import "../assets/css/mixin.scss";
.compose-page {
  background: url(../assets/img/second/bg.jpg) center center;
  background-size: cover;
}
.compose-area {
  width: 605px;
  height: 1035px;
  margin: 68px auto 0;
  display: flex;
  position: relative;
  .compose-content {
    position: absolute;
    top: 50%;
    transform: translate3d(0, -50%, 0);
    overflow: hidden;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    filter:drop-shadow(5px 5px 20px rgba($color: #000, $alpha: 0.5))
  }
  img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: all;
  }
}
.text-tip {
  font-size: 28px;
  line-height: 1;
  color: #fff;
  margin: 21px auto 27px;
  pointer-events: none;
  span {
    text-decoration: underline;
  }
}
.btn-lottery {
  @include wh(479, 88);
  background: url(../assets/img/second/btn_bg.png) center no-repeat;
  background-size: 100% 100%;
  margin:  0 auto;
  font-size: 40px;
  color: white;
  line-height: 88px;
  text-align: center;

}
</style>
